PROGCR -- Prepares Programs for Copyrighting Copyright (c) 1994 by David M. Wincelberg Table of Contents I. Introduction .................................................. 1 II. How to Use .................................................... 2 Appendices: A. Command Line Switches ......................................... 3 B. Initialization (.INI) File .................................... 4 C. Troubleshooting ............................................... 5 D. Other FileJockey Software Products ............................ 5 E. License Agreement ............................................. 5 I. Introduction "[I]t's common practice to strip these [program] comments from the source code before registering it." [1] Thank you for trying PROGCR. This program protects the privacy of your C/C++ or PASCAL source code copyright deposit by removing comments after each file's header (which should primarily consist of your copyright notice) from copies of the original files. It also copies words displayed by standard or user-specified print commands to a file for spell checking. If you decide to keep this program after 30 days, you are required to pay the $10 license and registration fee in order to use this program legally, receive technical support and be notified of updates and bug fixes. Otherwise, you may not keep the individual files on your PC but you may keep the .ZIP file. A registration form is provided for you in the file PROGCR.REG. Please make your check or money order for $10 payable to David Wincelberg and mail it to David Wincelberg FileJockey Software 289 S. Robertson Blvd., #373 Beverly Hills, CA 90211 Send comments, suggestions and problem reports to me at 71573,1023 by CompuServe (not Internet) e-mail or at the above postal address. I plan to read each one, but, if I receive a large amount of mail, I may not be able to reply to each letter. You may share this program with others. Please tell the recipient(s) that the amount you are charging, if any, does not include the license and registration fee and include the original initialization (.INI) and documentation files. This product is not available directly from me. It is only available from bulletin boards, friends, shareware distributors, etc. PROGCR requires DOS 2.1 or higher. Although some program functions require a higher DOS version, these functions may be bypassed or will ask you for assistance. See the troubleshooting guide (Appendix C) for further information. II. How to Use II. A. Simple Examples To run this program on all your .C files in the current directory, enter PROGCR *.c provided PROGCR is on your computer's path. If you want to run the program only on some of the files in this directory, enter PROGCR *.c /P The program will then present you with dialog boxes to ask you whether or not to prepare each .C file for copyrighting. At any of these dialog boxes, you may tell the program to process the file, skip the file, process the remainder of the set (*.c), skip the remainder of the set or exit the program. The output files will have the same base names as the input files but will have extension .CR or .CRx where x is a user-specified DOS file name character. In addition, the program will create a file SPELL.LST which will contain words to spell check using a word processor. II. B. Command Line Options PROGCR supports two command line switches or options: /P and /O. /P tells the program to prompt for confirmation before preparing each file and /O instructs the program to overwrite output files without asking the user for approval. These switches may be placed before or after file names and may be followed by a minus sign (-) to have the opposite effect. The turn-off capability is provided since you can change the default behavior of the program by modifying the PROGCR.INI file. (See Appendix B.) II. C. Welcome Message The first time you run PROGCR (except with the /? switch) you will see the following message: Welcome New User! The documentation for this program is in PROGCR.TXT. The license fee, after 30 days evaluation, is $10.00. If you keep getting this message, change "SkipNewUser=off" to "SkipNewUser=on" in PROGCR.INI. Press any key to prepare program files ... As the message states, there is a way to turn off this message in the event the program does not detect that it has already run on your computer. This message will not reappear after 30 days or any other time interval. It is only intended to welcome new users of PROGCR, tell them where to find this documentation file and to state the license fee. II. D. The SPELL.LST File After the program finishes, there will be a SPELL.LST file in each directory represented on the command line. For example, PROGCR prog1\*.c prog2\*.pas will result in a SPELL.LST file in prog1 and prog2. This file will consist of all words to be displayed on the screen by standard or user-specified print commands. (See Appendix B for how to add to the print commands already in the .INI file.) Since the string argument to printf and similar C/C++ commands contains editing codes that may confuse a spell checker, PROGCR removes these codes. II. E. Just Type PROGCR If you just enter PROGCR, the program will pop-up a dialog box displaying the help message and asking you to enter up to ten file names or switches. You may instead enter /? to leave the help message on your screen. It disappears if you just press . II. F. Program Headers Each file's header should at least contain the file name and your copyright notice. You may also wish to include a brief description of the purpose(s) of the routines contained in the file. PROGCR does not remove comments from program headers. A header is defined to start at the beginning of the file and end with the first blank line that is not in a comment. II. G. Line Editing You will get a dialog box with line editing if PROGCR cannot find PROGCR.INI or you did not enter any command line arguments. The line editor starts in overtype mode. Press to toggle between overtype and insert mode and press to clear the line. Otherwise, the line editor should behave consistently with other line editors. Appendices A. Command Line Switches Entering PROGCR /? produces the following summary of command line switches (also called options). Examples of using PROGCR are given in section II above. Switches apply to all specified files and may precede or follow file names. Prepares Programs for Copyrighting (Look for .CR? and SPELL.LST files) Usage: PROGCR file1 [file2 ...] [/P[-]] [/O[-]] /P Prompt for confirmation before preparing each file /O Always overwrite output files Follow with "-" to turn off prompting or overwriting file1 ... File(s) to prepare (wildcards OK) The next section describes how to change the default behavior for prompting and overwriting. B. Initialization (.INI) File The program looks for PROGCR.INI in the directory containing PROGCR.EXE or in the root directory of the current drive (for DOS 2.x). This file is divided into sections with each section headed by a word in brackets. Following this are lines for data entries that consist of a word, an equal sign and data. Note that PROGCR makes a backup copy of the .INI file and names it PROGCR.BAK the first time the program detects it is being run from another computer. Following is a description of each data entry in each section. [Options] Defaults for command line options (switches). Prompt=off Prompt for confirmation if value is "on", "yes" or "1" (case insensitive). AlwaysOverwrite=off Always overwrite the output files (.CR?) if value is "on", "yes" or "1". [Program Header] HeaderDetect=on Copy headers to output files (without modification) if the value is "on", "yes" or "1". MaxHeaderLines=1000 Maximum number of lines to consider part of headers. [C/C++] List of standard and user-specified print [PASCAL] commands for the specified language. CaseSensitive=yes Print commands are compared in a case sensitive manner if the value is "on", "yes" or "1". Print1=printf;sprintf Sample print command entry. Notice that the entry name ends in "1". Subsequent entry names must end in "2", "3", etc. Several print commands may be placed on a line if they are separated by semicolons, spaces or tabs (and the line length does not exceed 127 characters). You may include data types, such as char, and array names to catch words that are part of a string. See PROGCR.INI for more examples. [New User] SkipNewUser=off Set to "on", "yes" or "1" to skip the welcome message. VolCSerNo= Serial number for drive C. Used by the welcome message routine to detect running PROGCR on a different computer. C. Troubleshooting Repeated welcome messages: Set "SkipNewUser=on" in the [New User] section of PROGCR.INI. Although the new user detection routine requires DOS 4.0 or higher, it should work satisfactorily when it starts with the original PROGCR.INI file and subsequently uses the updated file that it creates. The original PROGCR.INI is saved as PROGCR.BAK. Out of memory: Finish any programs that you are running and try PROGCR again. Directory errors: File read/write errors: Check if your target disk is full or write protected. If not, try a disk repair utility to fix your disk. There are now such utilities in recent versions of DOS. For serious problems, you may wish to consider a third party product. Missing or can't find PROGCR.INI: Chances are you are using DOS 2.x. In this case, the program cannot find where it is running from and looks for the .INI file on the root of the default directory. So, copy PROGCR.INI to the root of each disk from which you will be running the program. D. Other FileJockey Software Products Following is a list of current FileJockey Software products. All of the compressed files for these products have extension ZIP. In parentheses after the descriptions are the locations where the programs may be found on CompuServe and the registration/license fees. CFWRAP 1.0 -- Word Wrapping Tuned for CompuServe(R) Capture Files: This program prepares CompuServe capture files for editing by removing page pause lines ("Press for more !", etc.) and word-wrapping various types of paragraphs (including each line starting with ">>" and indented paragraphs). Many page pause lines are in a user- changeable .INI file. (GO IBMCOM, Library 2, $15) E. License Agreement This is a legal agreement between you ("Licensee") and FileJockey Software ("Licensor"). Licensor owns all worldwide rights, title, copyright and other interests in and to the computer program identified as PROGCR 1.0 ("Software"). By using the Software, you are agreeing to be bound by the following terms: 1. Licensor grants to Licensee the non-exclusive and non-assignable right to use the Software for a period of 30 days without paying a fee to Licensor. After 30 days, Licensee may continue this right by paying $10 to Licensor. 2. Licensee may distribute copies of the Software and related files to others provided Licensee informs the recipients that the Software is subject to a license agreement and that the fee you charge, if any, does not include the $10 license fee. 3. Licensor hereby alerts Licensee that the Software, accompanying documentation, and the initialization (.INI) file are provided "AS IS" without warranty of any kind. Licensor assumes all risks involving use of the Software and its results and performance. 4. Licensee hereby acknowledges that Licensor bears no responsibility or liability which may arise or result from Licensee's use of the Software. Licensee hereby waives and releases Licensor from any and all claims for damages, losses and costs therefrom. In no event shall Licensor's liability for any damages ever exceed the price paid for license and registration, regardless of the form of the claim. 5. This license agreement shall be construed and enforced in accordance with the laws of the State of California. This agreement may not be modified except by written instrument signed by both parties. If any provisions of this agreement are found to be invalid or unenforceable by the operation of the law, then invalidity or unenforceability of such provision(s) shall not affect the validity or enforceability of the other provisions of this agreement. Any dispute arising from this agreement shall be submitted to California courts located in Los Angeles County, and Licensee hereby submits to the jurisdiction of such courts. All (registered) trademarks and (registered) service marks are properties of their respective companies. ----------- [1] Salone, M. J., Elias, S., ed., "How to Copyright Software," 3rd. ed., Nolo Press, Berkeley, CA, 1989, p. 10/6.